package www.openteam.com.presenter.prdctnMngmnt;

import java.util.HashMap;

import www.openteam.com.base.BasePresenter;
import www.openteam.com.bean.OutFactoryMsg;
import www.openteam.com.contract.PrdctnMngmnt.SendRCKSearchContract;
import www.openteam.com.model.PrdctnMngmnt.SendRCkSearchModel;
import www.openteam.com.model.qualityCntrl.FQCModel;
import www.openteam.com.mvp.IModel;
import www.openteam.com.ui.prdctnMngmnt.SendRCKSearchFragment;

/**
 * Created by Administrator on 2019-06-17.
 */

public class SendRCKSearchPrst extends BasePresenter<SendRCKSearchFragment> implements
        SendRCKSearchContract.SendRCKSearchPresenter{

    @Override
    public HashMap<String, IModel> getiModelMap() {
        return loadModelMap(new SendRCkSearchModel());
    }

    @Override
    public HashMap<String, IModel> loadModelMap(IModel... models) {
        HashMap<String, IModel> hashMap = new HashMap<>();
        hashMap.put("SendRCkSearchModel", models[0]);
        return hashMap;
    }

    @Override
    public void findOutFactoryMsg() {
        ((SendRCkSearchModel)getiModelMap().get("SendRCkSearchModel")).findOutFactoryMsg(new SendRCkSearchModel.OutFactoryListener() {
            @Override
            public void success(OutFactoryMsg outFactoryMsg) {
                getIView().findOutFactoryMsg(outFactoryMsg);
            }

            @Override
            public void fail(Throwable e) {
                getIView().findOutFactoryMsgfail(e.getMessage());
            }
        });
    }
}
